package com.ssy.lingxi.marketing.model.constant;

import com.ssy.lingxi.common.language.LanguageHolder;

import java.util.Arrays;

/**
 *  优惠券-操作记录-固定描述
 * @author ds
 * @date 2022/2/15
 * @version 2.0.0
 */
public enum CouponStrOperateEnum {

    /**[1,100]平台优惠券 */
    pt_inner_add(1,"新增平台优惠券"),
    pt_inner_submit_audit(2,"提交审核"),
    pt_inner_examine_step1(3,"审核平台优惠券(一级)"),
    pt_inner_examine_step2(4,"审核平台优惠券 (二级)"),
    pt_inner_submit(5,"提交平台优惠券"),
    pt_inner_cancel(6,"取消"),
    pt_inner_stop(7,"终止"),
    pt_inner_start(8,"启动"),


    /**[101,200]优惠券 */
    mc_inner_add(101,"新增商家优惠券"),
    mc_inner_submit_audit(102,"提交审核"),
    mc_inner_examine_step1(103,"审核商家优惠券(一级)"),
    mc_inner_examine_step2(104,"审核商家优惠券 (二级)"),
    mc_inner_submit(105,"提交商家优惠券"),
    mc_inner_cancel(106,"取消"),
    mc_inner_stop(107,"终止"),
    mc_inner_start(108,"启动"),
    ;
    private final Integer code;
    private final String message;

    CouponStrOperateEnum(Integer code, String message) {
        this.code = code;
        this.message = message;
    }

    public Integer getCode() {
        return code;
    }

    public String getMessage() {
        return LanguageHolder.getName(this.getClass(), this.code);
    }

    public static String getMessage(Integer code) {
        return Arrays.stream(CouponStrOperateEnum.values()).filter(e -> e.getCode().equals(code)).findFirst().map(CouponStrOperateEnum::getMessage).orElse("");
    }


}
